package com.imstlife.vending.broadcast;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.net.ConnectivityManager;

import com.imstlife.vending.activity.BaseActivity;
import com.imstlife.vending.utils.NetUtil;
import com.imstlife.vending.utils.T;

public class OnNetWorkStateChangeReceiver extends BroadcastReceiver {




    @Override
    public void onReceive(Context context, Intent intent) {



        if(ConnectivityManager.CONNECTIVITY_ACTION.equals(intent.getAction())){

            if(BaseActivity.event!=null){
                BaseActivity.event.onNetChange(NetUtil.getNetWorkState(context));
            }
            T.showLong(context,"网络状态发生变化");

        }
    }


//
//
//        @Override
//        public void onReceive(Context context, Intent intent) {
//
//             if(ConnectivityManager.CONNECTIVITY_ACTION.equals(intent.getAction())){
//                event.onNetChange(NetUtil.getNetWorkState(context));
//             }
//        }
    }
